//页面缩放监听
window.onresize = function(){
    var searchWidth =$('.all-search').width(); //搜索栏宽度
    if(searchWidth < 1200){ // 宽度小于1200
        $('.all-search').css('height','160px');
        $('.all-search-ipt input').css('width','280px');
        $('.all-search-ipt input').css('margin-bottom','20px');
        $('.all-search-submit').css('margin-top','-20px');
        $('.all-search-submit').css('margin-left','20px');
    }
    else{
        $('.all-search').css('height','120px');
        $('.all-search-ipt input').css('width','140px');
        $('.all-search-ipt input').css('margin-bottom','0px');
        $('.all-search-submit').css('margin-top','0px');
        $('.all-search-submit').css('margin-left','0px');
    }

    if(searchWidth<900){
        $('.tree-and-table').css('margin-top','100px')
    }else{
        $('.tree-and-table').css('margin-top','12px')
    }

}
// 搜索栏的自定义配置
$(function(){
    window.onresize();
})

//隐藏搜索栏按钮
$(".hide-btn").click(function(){
    var h = $('.all-search').css('height');
    if(	$('.hide-btn span').text()=='展开搜索'){
        $(".all-search-form").slideDown("normal");
        window.onresize();
        $('.hide-btn span').text('隐藏搜索');
        $('.hide-i').removeClass('layui-icon-triangle-r');
        $('.hide-i').addClass('layui-icon-triangle-d');
    }else{
        $(".all-search-form").slideUp("normal");
        $('.all-search').css('height','40px');
        $('.hide-btn span').text('展开搜索');
        $('.hide-i').removeClass('layui-icon-triangle-d');
        $('.hide-i').addClass('layui-icon-triangle-r');
    }
})